package com.aruba.mvvmapplication.viewmodel

import androidx.hilt.lifecycle.ViewModelInject
import androidx.lifecycle.ViewModel
import androidx.lifecycle.asLiveData
import androidx.lifecycle.viewModelScope
import androidx.paging.cachedIn
import com.aruba.mvvmapplication.repository.MovieRepositoryImpl
import com.aruba.mvvmapplication.repository.Repository

/**
 * Created by aruba on 2021/9/25.
 */
class MovieViewModel @ViewModelInject constructor(
    private val repository: MovieRepositoryImpl
) : ViewModel() {
    val data = repository.fetchList().cachedIn(viewModelScope).asLiveData()
}